package com.mcp_life.module.userbasemodules.mapper;

import com.mcp_life.entity.pojo.User;
import com.mcp_life.entity.pojo.PersonalAccount;
import com.mcp_life.entity.pojo.RealNameAuthDetail;
import com.mcp_life.entity.vo.UserVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
  //  @Select("select * from user where account = #{account}")
    User findByAccount(String account);
  //  @Select("select * from user where account = #{account} and password = #{password}")
    User authenticate(String account, String password);
//@Insert("insert into user(user_id,account, password, nickname,gender,avatar,is_real_name,role,create_time,update_time,status) values(#{userId},#{account}, #{password}, #{nickname},#{gender},#{avatar},#{isRealName},#{role},#{createTime},#{updateTime},#{status})")
    void insert(User user);
//@Select("select * from user where user_id = #{userId}")
    User findByUserId(String userId);

    void update(User user);
//@Insert("insert into real_name_auth_detail(name,id_card_number,status,update_time,create_time,user_id) values(#{name},#{idCardNumber},#{status},#{updateTime},#{createTime},#{userId})")
    void insertRealNameAuthDetail(RealNameAuthDetail realNameAuthDetail);
//@Insert("insert into personal_account(account_number,account_balance,status,update_time,create_time,user_id) values(#{accountNumber},#{accountBalance},#{status},#{updateTime},#{createTime},#{userId})")
    void insertPersonalAccount(PersonalAccount personalAccount);
@Select("select * from user where user_id = #{userId}")
    UserVO getUserInfoByUserId(String userId);
}
